<@page.html title="储值卡查询">
<script type="text/javascript" src="${_appPath!}/js/cal.js"></script>
<script>
  function selAll(b) {
    var cbs = document.getElementsByName("cbids");
    if(cbs) {
      for(var i=0; i<cbs.length; i++)
        cbs[i].checked = b;
    }
  }
  function delSel() {
    var arr = [];
    var cbs = document.getElementsByName("cbids");
    if(cbs) {
      for(var i=0; i<cbs.length; i++)
        if(cbs[i].checked) arr.push(cbs[i].value);
    }
    if(arr.length==0) {
      window.alert("请先选择");
      return;
    }
    if(!window.confirm("确定要删除选择的"+arr.length+"张卡吗?")) return;
    oper('_del?id='+arr.join(","));
  }
</script>
  <div class="search">
    <form id="fm_query" action="_list">
      <dl>
        <dt>门店</dt>
        <dd><script>shopsel('shopCode');</script></dd>
        <dt>状态</dt>
        <dd><select name="status"><option value="">全部</option><option value="1">未使用</option><option value="2">已领用</option></select></dd>
        <dt>卡号范围</dt>
        <dd><input type="text" name="noFrom" value="" size="16" maxlength="20" />
          ~ <input type="text" name="noTo" value="" size="16" maxlength="20" /></dd>
        <dd class="button"><input type="button" value="查询" onclick="query();"></dd>
        <dd class="oper"><#if canDel??><a class="del" href="javascript:delSel();">删除配卡</a></#if></dd>
      </dl>
    </form>
  </div>
  <div id="div_list"></div>
<script type="text/javascript">query();</script>
</@page.html>